package com.ltd.zglmvptest.presenter;

import com.ltd.zglmvptest.base.BaseModel;
import com.ltd.zglmvptest.model.AvatarListModel;
import com.ltd.zglmvptest.view.AvatarListView;

import java.util.List;

/**
 * Created by chinalin on 2017/5/2.
 */

public class AvatarListPresenter {
    //Model层中的model，用来获取数据
    private BaseModel model;
    //View层的View，即实现了该接口的activity
    private AvatarListView view;

    /**
     * Presenter从网络上取得数据并且交由View处理
     */
    public void fetch()
    {
        view.showProgress();
        model = new AvatarListModel();
        model.loadData(new AvatarListModel.ResultCallBack()
        {
            @Override
            public void onResult(List result)
            {
                view.showData(result);
            }
        });
    }
}
